package com.sds.shop.action;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.CategoryDAO;
import com.sds.shop.dao.ProductDAO;
import com.sds.shop.vo.CategoryVO;

public class ProductRegistAction extends Action{
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		ArrayList<CategoryVO> categoryList = CategoryDAO.getInstance().getCategoryList();
		String maxProductNumber = ProductDAO.getInstance().getMaxProductNumber();
		
		request.setAttribute("categoryList", categoryList);
		request.setAttribute("maxProductNumber", maxProductNumber);
		
		HttpUtil.forward(request, response, "/jsp/productRegist.jsp");
	}
}
